package com.company.restaurant.dto;

/**
 * Description of class.
 * Created 5/15/14 5:28 PM
 *
 * @author andrey.rodin@playtech.com
 */

public enum MessageIds {
    // 10000+
    LOGIN_REQUEST(10000),
    LOGIN_RESPONSE(10001),
    PING(10002),
    PONG(10003)
    ;

    int code;
    private MessageIds(int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public static MessageIds getByCode(int code) {
        for (MessageIds ids : values()) {
            if (ids.getCode() == code) {
                return ids;
            }
        }
        return null;
    }
}
